package com.vue.admin.service.common.mybatis.mapper;

import com.vue.admin.service.common.mybatis.provider.BaseDefInsertProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import tk.mybatis.mapper.annotation.RegisterMapper;

import java.util.List;

/**
 * @program: tk-robot-service
 * @description:
 * @author: zhangyangyang
 * @create: 2020-01-07 10:05
 **/
@RegisterMapper
public interface BaseDefInsertListMapper<T> {

    /**
     * 批量插入数据库，所有字段都插入，包括主键
     *
     * @return
     */
    @Options(useGeneratedKeys = true, keyProperty = "id")


    @InsertProvider(
            type = BaseDefInsertProvider.class,
            method = "insertList"
    )

    /**
     * 批量插入
     * @param recordList
     * @return
     */
    int insertList(List<T> recordList);

}
